package org.knife.springbootlearn;

import org.knife.autoconfigure.springbootlearn.EnableSpringbootLearn;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

@SpringBootApplication
@EnableSpringbootLearn
public class SpringbootLearnApplication {
    public static final Logger LOGGER = LoggerFactory.getLogger(SpringbootLearnApplication.class);


    public static void main(String[] args) {
        SpringApplication.run(SpringbootLearnApplication.class, args);
        try {
            InputStream inputStream = SpringbootLearnApplication.class.getClassLoader().getResourceAsStream("application-dev.yml");
            Properties properties = new Properties();
            properties.load(inputStream);
            LOGGER.info("===============================================");
            LOGGER.info("服务启动成功:http://localhost:"+ properties.getProperty("port"));
            LOGGER.info("===============================================");
        } catch (IOException e) {
            LOGGER.error("服务启动日志输出异常");
        }
    }

}
